1. Field of the Invention
The present invention relates to a semiconductor device. More particularly, the present invention relates to a circuit technique for reducing fluctuations in the output characteristic of a comparator due to temperature changes, in a semiconductor device including a power element and a comparator integrated in the same semiconductor substrate, where a detection voltage is obtained from a semiconductor element which is provided on the substrate and has significant fluctuation in the temperature characteristic thereof while a reference voltage is obtained from an external component which has insignificant fluctuation in the temperature characteristic thereof.
2. Description of the Related Art
In order to suppress the fluctuations in the output characteristic of a comparator due to temperature changes, the temperature characteristic of an element for obtaining a detection voltage (hereinafter, referred to simply as "detection element") and that of an element for obtaining a reference voltage (hereinafter, referred to simply as "reference element") should be considered together.
To do so in a semiconductor device with a comparator provided therein, for example, it is typical to provide both the detection element and the reference element on a semiconductor substrate, or to provide both of the elements as external components. In the former case where both of the elements are provided on a semiconductor substrate, the output characteristic of the comparator is stable against temperature changes but is also fixed, whereby a user cannot arbitrarily set the output characteristic of the comparator. In the latter case where both of the elements are provided as external components, although the user can arbitrarily set the output characteristic of the comparator, two additional external connection terminals are required for each comparator, thereby increasing the number of external terminals required in the semiconductor device.
In order to reduce the size of the semiconductor device and the number of the external terminals, while allowing for the arbitrary setting of the output characteristic of the comparator, it is necessary to obtain the reference voltage of the comparator from an externally provided component.
FIG. 7 illustrates a conventional example where the reference voltage of a comparator is obtained from an externally provided component. In FIG. 7, a semiconductor device 1 includes a comparator 2 and a detection element 3, which is a semiconductor element, both provided on a semiconductor substrate. Reference numeral 4 denotes an external connection terminal, and 5 denotes an output terminal of the comparator 2. A constant current source 6 and an externally provided resistor 7 for obtaining a reference voltage (hereinafter, "external reference resistor 7") are connected to the external connection terminal 4.
The comparator 2 includes a detection side circuit, a reference side circuit and a constant current source 16. The detection side circuit includes a constant current source 8, a transistor 10 and a transistor 11. The reference side circuit includes a constant current source 12, a transistor 14 and a transistor 15. The transistors 10 and 14 are each called a "buffer element", and the transistors 11 and 15 are each called a "differential element".
The reference voltage of the comparator 2 is a voltage generated at the external reference resistor 7, and the detection voltage of the comparator 2 is a voltage generated at the detection resistor 3. The reference terminal of the comparator 2 is provided as an external connection terminal so that the output characteristic of the comparator 2 can be set arbitrarily by setting the reference voltage to be generated at the external reference resistor 7.
However, in the comparator 2 illustrated in FIG. 7, the reference voltage of the comparator 2 is a voltage generated at the external reference resistor 7. Since the external reference resistor 7 is an externally provided element, the fluctuation of the reference voltage due to temperature changes is insignificant. On the other hand, the detection voltage of the comparator 2 is a voltage generated at the detection resistor 3. Since the detection resistor 3 is provided on the semiconductor substrate, the fluctuation of the detection voltage due to temperature changes may be significant. Therefore, there may be a difference in temperature characteristic between the detection voltage and the reference voltage of the comparator 2, whereby the output characteristic of the comparator 2 fluctuates due to temperature changes. Particularly, when a power element is provided on the semiconductor substrate, the fluctuation of the detection resistor 3 due to temperature changes is further increased by heat generated by the power element, whereby the output characteristic of the comparator significantly fluctuates due to temperature changes.